<!DOCTYPE html>
<html>
<head>
    <title>máy tính linh kiện</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen"
          charset="utf-8"/>

    <link href="css/style.css" media="all" type="text/css" rel="stylesheet">
    <link href="css/normalize.css" media="all" type="text/css" rel="stylesheet">
    <link href="css/skeleton.css" media="all" type="text/css" rel="stylesheet">
    <link media="screen,projection" type="text/css" href="js/slider/nivo-slider.css" rel="stylesheet">
    <link rel="stylesheet" href="js/slider/themes/default/default.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="css/jquery-ui.css"/>

    <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
    <script type="text/javascript " src="js/slider/jquery.nivo.slider.js"></script>
    <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script src="js/jquery-ui.js"></script>
    <script src="admin/js/login.js"></script>
</head>

<body class="home page page-id-203 page-template page-template-page-home-php">
<div id="fb-root"></div>
<script>(function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s);
        js.id = id;
        js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

<div id="main">
    <div id="main-wrap">
        <header id="header">

            <div class="container_12 clearfix">
                <div class="grid_12">
                    <?php
                    $path02 = "FileUpload/Slider";

                    $NoAnh02 = 0;
                    $filesAnh02 = array();
                    if ($handleFile02 = opendir($path02)) {
                        while (false !== ($fileAnh = readdir($handleFile02))) {
                            if ($fileAnh != "." && $fileAnh != ".." && (preg_match("/\.jpg|\.gif|\.png/i", $fileAnh))) {
                                $NoAnh02++;
                                array_push($filesAnh02, $fileAnh);
                            }
                        }
                        closedir($handleFile02);
                    }
                    ?>
                    <div class="before-content-home">
                        <div class="container_12 clearfix">
                            <div class="grid_8">
                                <section id="slider-wrapper">
                                    <div class="flexslider-holder">
                                        <div class="flexslider-container">
                                            <div class="slider-wrapper theme-default">
                                                <div id="slider" class="nivoSlider">
                                                    <?php for ($i = 0; $i < $NoAnh02; $i++) { ?>
                                                        <img src="<?php echo $path02 . "/" . $filesAnh02[$i]; ?>"/>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </section>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
            <div class="header-row">
                <nav class="primary">
                    <ul class="sf-menu sf-js-enabled" id="topnav">
                        <li class="current-menu-item">
                            <a href="index.php">Trang chủ<b></b></a>
                        </li>
                        <li>
                            <a href="about.php">Giới thiệu<b></b></a>
                        </li>

                        <li><a
                                href="product.php">Sản phẩm</a></li>
                        <li><a href="news.php">Tin tức - Khuyến mại<b></b></a>
                        </li>
                        <li><a href="contact.php">Liên hệ<b></b></a>
                        </li>
                        <?php if (!isset($_SESSION)) {
                            session_start();
                        }
                        if (!empty($_SESSION['success'])) {
                            ?>
                            <li><a href="admin/accountManagement.php">Quản lý<b></b></a>
                            </li>
                        <?php
                        }
                        ?>
                        <li>
                            <div class="top-row">
                                <div id="widget-header-1">
                                    <div id="my_textwidget-2">
                                        <div class="my_txt_widget icon1">
                                            <?php if (!isset($_SESSION)) {
                                                session_start();
                                            }
                                            if (empty($_SESSION['success'])) {
                                                ?>
                                                <form>
                                                    <input type="text" id="username" placeholder="tài khoản"/>
                                                    <input type="password" id="password" placeholder="mật khẩu"/>
                                                    <button type="button" onclick="login()">Đăng nhập</button>
                                                </form>
                                            <?php
                                            } else {
                                                ?>
                                                <p>Xin chào,
                                                    <button type="button" onclick="logout()"
                                                            style="padding-left: 5px; padding-right: 5px;">Thoát
                                                    </button>
                                                </p>
                                            <?php
                                            }?>
                                        </div>
                                    </div>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </li>
                    </ul>
                </nav>
                <div class="clear"></div>
            </div>
        </header>

        <div id="dialog" title="Thông báo" style="display: none">
            <p>Bạn đã chọn sản phẩm này cho giỏ hàng.</p>
        </div>